
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>推合 - Tuihe.com</title> 
<script type="text/javascript" src="http://tjs.sjs.sinajs.cn/t3/platform/js/api/wb.js"></script> 
</head> 
<body> 
 
<input id="login" type="button" value="login" onclick="login()" /> 
<input id="logout" type="button" value="logout" onclick="logout()" /> 
 
<input id="show" type="button" value="show my timeline" onclick="show()" /> 
<p> 
<textarea id="result" cols="50" rows="10"></textarea> 
</p> 
 
<script type="text/javascript"> 
function show() {
	var args = {};
	runCmd('/statuses/friends_timeline.json', args, function(sResult, bStatus) {
		//$("#result").val(sResult);
		document.getElementById("result").value = sResult[0].text;
	}, "POST");
}
 
function login() {
	WB.connect.login(function() {
		alert('Go');
	});
}
 
function logout() {
	WB.connect.logout(function() {
		alert('bye');
	});
}
 
function runCmd(apiMethod, args, callback, httpMethod) {
	if (httpMethod == null) httpMethod = "POST";
	WB.client.parseCMD(apiMethod, callback, args, httpMethod);
}
 
WB.core.load(['connect', 'client'], function() {
	var cfg = {
		key: '2182870411',
		xdpath: 'http://tuihe.com/xd.html'
	};
	WB.connect.init(cfg);
	WB.client.init(cfg);
});
</script> 
</body> 
</html>